<?php
/**
 * Translateone Controller for yos_translator Component
 * @package		yos_translator
 * @subpackage	Components
 * @link		http://yopensource.com
 * @author		yopensource
 * @copyright 	yopensource (yopensource@gmail.com)
 * @license		Commercial
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
jimport('joomla.filesystem.file');

/**
 * Translator Extension Controller
 *
 * @package		yos_translator
 * @subpackage	Components
 */
class YOS_NewsControllerCms extends YOS_NewsController
{
	/**
	 * constructor (registers additional tasks to methods)
	 * @return void
	 */
	function __construct()
	{
		parent::__construct();

		$this->registerTask('new', 'edit');
		$this->registerTask('apply', 'save');
		$this->registerTask('unpublish', 'publish');
	}
	function save(){
		global $mainframe;
		JRequest::checkToken() or jexit( 'Invalid Token' );
		$mName		= 'cmsmanager';
		$model = &$this->getModel($mName);
		// Check for request forgeries
		$model->save();		
		$msg = JText::_( 'Cms saved' );
		$mainframe->redirect( "index.php?option=com_yos_news_crawler&task=cmsmanager", $msg );		
	}	
}

